<?php
$op=$_GET['op'];
if($op=='getmsg')
{
	file_put_contents(S_ROOT.'/cache/123132.txt',var_export($_POST,true)."<br/>",FILE_APPEND);
	$success=$_POST["Status"];
	$remark=$_POST["ReMark"];
	$dbordernum=$_POST["OrderNo"];
	$orderNum=$_POST["CustomerOrderNo"];
	$timestamp=strtotime($_POST["ChargeTime"]);
    $time=time();
    $sql="select uid,actid from duibalist where dbordernum='$dbordernum' and dstatus=9";
    $info=getonerecord($sql);
    if($info)
    {
        $uid=$info['uid'];
        $actid=$info['actid'];
        if($success=='True')
        {
			//充值成功
            $sql="update duibalist set dstatus=1,finatime=".$timestamp." where dbordernum='$dbordernum'";
            exec_db($sql);
        }
        else
        {
			//充值失败，返还积分
            $sql="update duibalist set dstatus=4,errorid=1,finatime=".$timestamp.",errormsg='$remark' where dbordernum='$dbordernum'";
            exec_db($sql);
        }
    }
    echo '<?xml version="1.0" encoding="utf-8"?><root><ret><status>True</status></ret></root>';
}
//编码设置